package cn.wolfcode.luowowo.common.util;


import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter

public class AjaxResult implements Serializable {
    private boolean success = true;
    private int code;
    private String msg;
    private Object data;

    public AjaxResult() {
    }

    public AjaxResult(boolean success) {
        this.success = success;
    }

    public static final int RESPONSE_CODE_NOLOGIN = 102;

    public AjaxResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    //成功
    public static final AjaxResult SUCCESS = new AjaxResult();
    //失败
    public static final AjaxResult FAIL = new AjaxResult(false);


    public AjaxResult addData(Object data) {
        this.data = data;
        return this;
    }
}
